package demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 何华树
 * Date: 2024-09-06
 * Time: 8:51
 */
public class Test {
    public static void func_eat(Animal animal) {
        animal.eat();
    }
    public static void func_swim(ISwimming iSwimming) {
        iSwimming.swim();
    }
    public static void func_run(IRunning iRunning) {
        iRunning.run();
    }
    public static void main1(String[] args) {
        Dog dog = new Dog("旺财",10);
        func_eat(dog);
        func_run(dog);
        func_swim(dog);
        System.out.println("==============");
        Cat cat = new Cat("小虎",10);
        func_eat(cat);
        func_run(cat);
        func_swim(cat);

    }
}
